// packageE/search/search.js
Component({
  properties: {
    datas: {
      type: null
    },
    component_id: {
      type: null
    }
  },
  // 私有数据，可用于模板渲染
  data: {
    emptyImage: 'https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/image.png',
    clientWidth: '375',
    iPnoneBottomBol: false,
    showcarrfootBol: true,
  },

  lifetimes: {
    // 生命周期函数，可以为函数，或一个在methods段中定义的方法名
    attached() {
    },
    moved() {},
    detached() {},
  },

  // 生命周期函数，可以为函数，或一个在methods段中定义的方法名
  attached() {},
  // 此处attached的声明会被lifetimes字段中的声明覆盖
  ready() {
    this.getiPnoneBottom();
  },

  pageLifetimes: {
    // 组件所在页面的生命周期函数
    show() {},
    hide() {},
    resize() {},
  },
  methods: {
    openPster(e){
      console.log('触发哪个跳转');
      this.setData({
        isshow: true,
      });
    },
    getiPnoneBottom() {
      let that = this;
      try {
        var value = wx.getStorageSync("iPhoneBottom");
        if (value) {
          that.setData({
            iPnoneBottomBol: true,
          });
          // Do something with return value
        }
      } catch (e) {
        // Do something when catch error
      }
    },
    tosearch(){
      if(this.data.datas.web_design_enable == 1 && this.data.datas.search_page !== '3' && this.data.datas.search_type !== 'store' ){
        // 页面设置插件
          wx.navigateTo({
            url: '/packageI/searchPage/searchPage',
          });
        return;
      }
      if(this.data.datas.search_page === '3' || this.data.datas.search_page === 3) { //判断是否开启消费券搜索
        wx.navigateTo({
          url: '/packageI/searchPage/searchPage?searchPage='+ this.data.datas.search_page
        });
        return
      }
      
      if(this.data.datas.search_type === 'store') {
        wx.navigateTo({
          url: '/packageC/o2o/o2oSearch/o2oSearch?city=1&point={}'
        });
      }else {
        wx.navigateTo({
          url: '/packageB/member/category/search_v2/search_v2',
        });
      }
      

    }
  }
});
